Tdbs 1.2-16/SAMPLES.DOC

6.9 KB 5086466d775ece4a…
                  Documentation for the TDBS Sample Applications
                              Included with TDBS 1.2



        PLEASE NOTE

        The programs and source included with your TDBS are provided to 
        illustrate techniques.  You may use any or all of the programs' 
        source or techniques in any fashion you wish.  There are no fees 
        or restrictions imposed by eSoft, Inc. 

        INTRODUCTION

        In releasing these sample applications with TDBS 1.2, we have 
        attempted to provide useful examples of programming techniques and 
        methods.  The object was to emphasize the utility of the examples 
        so that you could build on them, take parts and integrate them 
        into your own applications, and so on.  Particular focus was 
        placed on TDBS extended commands and functions, since examples of 
        basic dBASE constructs are readily available in the mainstream.  
        In at least one case (.DIR file parsing in TAGDIR.PRG) we wanted 
        to present a code block that performed a function in high demand 
        with the new capabilities of TDBS 1.2.
        
        At the same time, the creation of programs of at least modest 
        usefulness was one of the goals.  This file documents how to use 
        the applications themselves. 

        TEXTREAD

        TEXTREAD is basically an enhanced replacement for a Type 1 
        command.  ANSI EMULATION IS REQUIRED - the program will report an 
        error if a non-ANSI user attempts to execute it!  

        It displays a text file one page at a time, and allows the user to 
        move forward and backward in the file, reporting a "% done" count.  
        Users can also download the file being read by the program.

        Install TEXTREAD like you would any other TDBS program.  The Opt 
        Data needs to reference the name of the text file.  An example Opt 
        Data follows:

                Opt Data=TEXTREAD /Q && C:\TBBS\FILE\MYFILE.TXT

        Please note that a double ampersand (&&) separates the name of the 
        TDBS program and TDBS switches from the name of the text file.
        
        USERLIST

        USERLIST is a simple user listing utility.  It allows a user to 
        see all users on the system by name and location.  This is a 
        highly requested TBBS feature, which is very simply in function.

        Install USERLIST like you would any other TDBS program.  PLEASE 
        NOTE!  The program should be installed in your TBBS directory (or 
        wherever your userlog files are located) as it expects the 
        USERLOG.BBS file to be in its own directory!  If not installed 
        where your userlog files are located, an error will be reported 
        upon execution of the program.

        To suppress the display of the location field, add a /NL switch to 
        the Opt Data line of the program, like this:

                Opt Data=USERLIST /Q && /NL

        Please note that a double ampersand (&&) separates the name of the 
        TDBS program and TDBS switches from the program switch (/NL).  
        
        USEARCH

        USEARCH is a user name finder utility.  It employs the new 
        SOUNDEX() function of TDBS 1.2 to perform "sounds like..." 
        searches.  

        For example, suppose you wanted to find ALAN BRYANT in the 
        userlog, but didn't know how he spells his first name.  With 
        USEARCH, you could enter "ALLEN" as a search key, and the program 
        would find all users whose name beings with something that sounds 
        similar.  In this case, it would list all the ALANs, ALLENs, 
        ALLANs, ALAINs, etc. in the userlog.

        SOUNDEX() uses a defined algorithm to make the comparisons.  The 
        rules for the algorithm are shown in the TDBS 1.2 manual (unless 
        you have the TDBS 1.2 UtilityPak) for reference.  Although not 
        always 100% accurate, the soundex algorithm is interesting to 
        study.  NOTE:  Soundex comparisons are only valid for English 
        pronunciations!

        Install USEARCH like you would any other TDBS program.  PLEASE 
        NOTE!  The program should be installed in your TBBS directory (or 
        wherever your userlog files are located) as it expects the 
        USERLOG.BBS file to be in its own directory!  If not installed 
        where your userlog files are located, an error will be reported 
        upon execution of the program. 
        
        SFILE

        SFILE is a simple "brute force" hypertext-like utility.  You 
        "point" the program at a particular file mask.  When a user 
        executes the program, it will search all the files that meet that 
        mask for a keyword entered by the user.  A list of the matches is 
        created, and the user may then download all the matching files.  
        If the list is too long, the files may be downloaded in small 
        batches. 

        Install SFILE like you would any other TDBS program.  The Opt Data 
        needs to reference the file mask, which usually includes 
        wildcards.  An example Opt Data follows: 

                Opt Data=SFILE /Q && D:\TEXTFILE\*.TXT

        Please note that a double ampersand (&&) separates the name of the 
        TDBS program and TDBS switches from the file mask.
        
        In this example, when executed, SFILE would prompt the user for 
        the desired search key.  It would then search all files on the D: 
        drive in the \TEXTFILE sub-directory with a .TXT file extension 
        for the keyword, building a list of any files which match the 
        keyword entered.  If any match, the user may download the text 
        files in which a match was found.  

        TAGDIR

        TAGDIR is a very simple download replacement for a Type 46 
        command, which sports a simple file tagging interface.  TAGDIR is 
        most likely not very useful as a program; its primary purpose is 
        to demonstrate coding methods.  

        If you'd like to try it out, install SFILE like you would any 
        other TDBS program.  The Opt Data needs to reference the name of 
        the DIR file (pseudo-directory).  An example Opt Data follows: 

                Opt Data=SFILE /Q && D:\FILE\UPLOADS\FILES.DIR

        Please note that a double ampersand (&&) separates the name of the 
        TDBS program and TDBS switches from the DIR file name. 

        The program lists files in the DIR file 7 at a time on the screen, 
        each file being numbered.  The user may enter the number of the 
        file to "tag" it for download.  Multiple numbers can be entered in 
        any syntax you wish (1, 2, 3;  123;  1 2 3;  etc.) to tag multiple 
        files.  Since downloads are triggered with a DOTBBS command, the 
        Opt Data length is limited.  Because of that, only 6 files maximum 
        can be tagged.